var app=angular.module("ydApp",["ngRoute","ngAnimate"])
.controller("ydCtrl",["$scope","$http",function($scope,$http){
$scope.page={pageNum:1};
}])
.config(["$routeProvider",function($routeProvider){
$routeProvider
.when("/home",{"templateUrl":"templates/pages/home.html"})
.when("/search",{"templateUrl":"templates/pages/search.html"})
.when("/regist",{"templateUrl":"templates/pages/regist.html"})
.otherwise({"redirectTo":"/home"})
}])
.controller("homeCtrl",["$scope","$http",function($scope,$http){
$scope.page.pageNum=1;

}])
.controller("searchCtrl",["$scope","$http",function($scope,$http){
$scope.page.pageNum=2;
$scope.cityitem="上海市"
$scope.provinces=null;
$scope.city=[];
$http.get("http://platform-api.1yd.me/api/meta-data/cities").success(
function(res){
$scope.provinces=res.provinces;
for (i=0;i<$scope.provinces.length;i++){
for (j=0;j<$scope.provinces[i].citys.length;j++){
$scope.searchIndefo.push($scope.provinces[i].citys[j])
}
}
for(i=0;i<$scope.searchIndefo.length;i++){
$scope.city.push($scope.searchIndefo[i].city_name)
console.log($scope.city)
}
})




}])
.controller("registCtrl",["$scope","$http",function($scope,$http){
$scope.page.pageNum=3;
}])

